3.273 \(\int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx\)

Optimal. Leaf size=132 \[ -\frac{(c-d) (A (c+3 d)+2 B (c-3 d)) \cos (e+f x)}{3 a^2 f (\sin (e+f x)+1)}+\frac{d x (A d+2 B (c-d))}{a^2}+\frac{d^2 (A-4 B) \cos (e+f x)}{3 a^2 f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2} \]

[Out]

(d*(2*B*(c - d) + A*d)*x)/a^2 + ((A - 4*B)*d^2*Cos[e + f*x])/(3*a^2*f) - ((c - d)*(2*B*(c - 3*d) + A*(c + 3*d)
)*Cos[e + f*x])/(3*a^2*f*(1 + Sin[e + f*x])) - ((A - B)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(3*f*(a + a*Sin[e
 + f*x])^2)

________________________________________________________________________________________

Rubi [A]  time = 0.509724, antiderivative size = 132, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 35, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {2977, 2968, 3023, 2735, 2648} \[ -\frac{(c-d) (A (c+3 d)+2 B (c-3 d)) \cos (e+f x)}{3 a^2 f (\sin (e+f x)+1)}+\frac{d x (A d+2 B (c-d))}{a^2}+\frac{d^2 (A-4 B) \cos (e+f x)}{3 a^2 f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a \sin (e+f x)+a)^2} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x])^2,x]

[Out]

(d*(2*B*(c - d) + A*d)*x)/a^2 + ((A - 4*B)*d^2*Cos[e + f*x])/(3*a^2*f) - ((c - d)*(2*B*(c - 3*d) + A*(c + 3*d)
)*Cos[e + f*x])/(3*a^2*f*(1 + Sin[e + f*x])) - ((A - B)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(3*f*(a + a*Sin[e
 + f*x])^2)

Rule 2977

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x]
)^n)/(a*f*(2*m + 1)), x] - Dist[1/(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n -
1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x],
x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ
[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin{align*} \int \frac{(A+B \sin (e+f x)) (c+d \sin (e+f x))^2}{(a+a \sin (e+f x))^2} \, dx &=-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2}+\frac{\int \frac{(c+d \sin (e+f x)) (a (2 B (c-d)+A (c+2 d))-a (A-4 B) d \sin (e+f x))}{a+a \sin (e+f x)} \, dx}{3 a^2}\\ &=-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2}+\frac{\int \frac{a c (2 B (c-d)+A (c+2 d))+(-a (A-4 B) c d+a d (2 B (c-d)+A (c+2 d))) \sin (e+f x)-a (A-4 B) d^2 \sin ^2(e+f x)}{a+a \sin (e+f x)} \, dx}{3 a^2}\\ &=\frac{(A-4 B) d^2 \cos (e+f x)}{3 a^2 f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2}+\frac{\int \frac{a^2 c (2 B (c-d)+A (c+2 d))+3 a^2 d (2 B (c-d)+A d) \sin (e+f x)}{a+a \sin (e+f x)} \, dx}{3 a^3}\\ &=\frac{d (2 B (c-d)+A d) x}{a^2}+\frac{(A-4 B) d^2 \cos (e+f x)}{3 a^2 f}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2}+\frac{((c-d) (2 B (c-3 d)+A (c+3 d))) \int \frac{1}{a+a \sin (e+f x)} \, dx}{3 a}\\ &=\frac{d (2 B (c-d)+A d) x}{a^2}+\frac{(A-4 B) d^2 \cos (e+f x)}{3 a^2 f}-\frac{(c-d) (2 B (c-3 d)+A (c+3 d)) \cos (e+f x)}{3 f \left (a^2+a^2 \sin (e+f x)\right )}-\frac{(A-B) \cos (e+f x) (c+d \sin (e+f x))^2}{3 f (a+a \sin (e+f x))^2}\\ \end{align*}

Mathematica [B]  time = 1.63466, size = 338, normalized size = 2.56 \[ \frac{\left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right ) \left (6 \cos \left (\frac{1}{2} (e+f x)\right ) \left (A d (4 c+d (3 e+3 f x-4))+B \left (2 c^2+2 c d (3 e+3 f x-4)+d^2 (-6 e-6 f x+5)\right )\right )-\cos \left (\frac{3}{2} (e+f x)\right ) \left (2 A \left (2 c^2+8 c d+d^2 (3 e+3 f x-10)\right )+B \left (8 c^2+4 c d (3 e+3 f x-10)+d^2 (-12 e-12 f x+41)\right )\right )+6 \sin \left (\frac{1}{2} (e+f x)\right ) \left (-2 d \cos (e+f x) (-A d (e+f x)-2 B c (e+f x)+2 B d (e+f x+1))+2 A c^2+4 A c d+4 A d^2 e+4 A d^2 f x-6 A d^2+2 B c^2+8 B c d e+8 B c d f x-12 B c d-B d^2 \cos (2 (e+f x))-8 B d^2 e-8 B d^2 f x+9 B d^2\right )+3 B d^2 \cos \left (\frac{5}{2} (e+f x)\right )\right )}{12 a^2 f (\sin (e+f x)+1)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2)/(a + a*Sin[e + f*x])^2,x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(6*(A*d*(4*c + d*(-4 + 3*e + 3*f*x)) + B*(2*c^2 + d^2*(5 - 6*e - 6*f*x)
 + 2*c*d*(-4 + 3*e + 3*f*x)))*Cos[(e + f*x)/2] - (B*(8*c^2 + d^2*(41 - 12*e - 12*f*x) + 4*c*d*(-10 + 3*e + 3*f
*x)) + 2*A*(2*c^2 + 8*c*d + d^2*(-10 + 3*e + 3*f*x)))*Cos[(3*(e + f*x))/2] + 3*B*d^2*Cos[(5*(e + f*x))/2] + 6*
(2*A*c^2 + 2*B*c^2 + 4*A*c*d - 12*B*c*d - 6*A*d^2 + 9*B*d^2 + 8*B*c*d*e + 4*A*d^2*e - 8*B*d^2*e + 8*B*c*d*f*x
+ 4*A*d^2*f*x - 8*B*d^2*f*x - 2*d*(-2*B*c*(e + f*x) - A*d*(e + f*x) + 2*B*d*(1 + e + f*x))*Cos[e + f*x] - B*d^
2*Cos[2*(e + f*x)])*Sin[(e + f*x)/2]))/(12*a^2*f*(1 + Sin[e + f*x])^2)

________________________________________________________________________________________

Maple [B]  time = 0.092, size = 489, normalized size = 3.7 \begin{align*} -2\,{\frac{B{d}^{2}}{{a}^{2}f \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) }}+2\,{\frac{A\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ){d}^{2}}{{a}^{2}f}}+4\,{\frac{Bd\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) c}{{a}^{2}f}}-4\,{\frac{B\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ){d}^{2}}{{a}^{2}f}}-2\,{\frac{A{c}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{A{d}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+4\,{\frac{Bcd}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}-4\,{\frac{B{d}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) }}+2\,{\frac{A{c}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-4\,{\frac{Acd}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}+2\,{\frac{A{d}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-2\,{\frac{B{c}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}+4\,{\frac{Bcd}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-2\,{\frac{B{d}^{2}}{{a}^{2}f \left ( \tan \left ( 1/2\,fx+e/2 \right ) +1 \right ) ^{2}}}-{\frac{4\,A{c}^{2}}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}+{\frac{8\,Acd}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}-{\frac{4\,A{d}^{2}}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}+{\frac{4\,B{c}^{2}}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}-{\frac{8\,Bcd}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}}+{\frac{4\,B{d}^{2}}{3\,{a}^{2}f} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) +1 \right ) ^{-3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x)

[Out]

-2/f/a^2*B*d^2/(1+tan(1/2*f*x+1/2*e)^2)+2/f/a^2*A*arctan(tan(1/2*f*x+1/2*e))*d^2+4/f/a^2*d*B*arctan(tan(1/2*f*
x+1/2*e))*c-4/f/a^2*B*arctan(tan(1/2*f*x+1/2*e))*d^2-2/f/a^2/(tan(1/2*f*x+1/2*e)+1)*A*c^2+2/f/a^2/(tan(1/2*f*x
+1/2*e)+1)*A*d^2+4/f/a^2/(tan(1/2*f*x+1/2*e)+1)*B*c*d-4/f/a^2/(tan(1/2*f*x+1/2*e)+1)*B*d^2+2/f/a^2/(tan(1/2*f*
x+1/2*e)+1)^2*A*c^2-4/f/a^2/(tan(1/2*f*x+1/2*e)+1)^2*A*c*d+2/f/a^2/(tan(1/2*f*x+1/2*e)+1)^2*A*d^2-2/f/a^2/(tan
(1/2*f*x+1/2*e)+1)^2*B*c^2+4/f/a^2/(tan(1/2*f*x+1/2*e)+1)^2*B*c*d-2/f/a^2/(tan(1/2*f*x+1/2*e)+1)^2*B*d^2-4/3/f
/a^2/(tan(1/2*f*x+1/2*e)+1)^3*A*c^2+8/3/f/a^2/(tan(1/2*f*x+1/2*e)+1)^3*A*c*d-4/3/f/a^2/(tan(1/2*f*x+1/2*e)+1)^
3*A*d^2+4/3/f/a^2/(tan(1/2*f*x+1/2*e)+1)^3*B*c^2-8/3/f/a^2/(tan(1/2*f*x+1/2*e)+1)^3*B*c*d+4/3/f/a^2/(tan(1/2*f
*x+1/2*e)+1)^3*B*d^2

________________________________________________________________________________________

Maxima [B]  time = 1.51886, size = 1122, normalized size = 8.5 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

-2/3*(2*B*d^2*((12*sin(f*x + e)/(cos(f*x + e) + 1) + 11*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 9*sin(f*x + e)^3
/(cos(f*x + e) + 1)^3 + 3*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 5)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1
) + 4*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 4*a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*a^2*sin(f*x + e)
^4/(cos(f*x + e) + 1)^4 + a^2*sin(f*x + e)^5/(cos(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))
/a^2) - 2*B*c*d*((9*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 4)/(a^2 + 3*a^2*
sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e)
 + 1)^3) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) - A*d^2*((9*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(
f*x + e)^2/(cos(f*x + e) + 1)^2 + 4)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(
f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) +
A*c^2*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a^2 + 3*a^2*sin(f*x + e
)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) +
B*c^2*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 1)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e
)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + 2*A*c*d*(3*sin(f*x + e)/(cos(f*x + e) +
1) + 1)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x
 + e)^3/(cos(f*x + e) + 1)^3))/f

________________________________________________________________________________________

Fricas [B]  time = 2.15878, size = 863, normalized size = 6.54 \begin{align*} -\frac{3 \, B d^{2} \cos \left (f x + e\right )^{3} -{\left (A - B\right )} c^{2} + 2 \,{\left (A - B\right )} c d -{\left (A - B\right )} d^{2} + 6 \,{\left (2 \, B c d +{\left (A - 2 \, B\right )} d^{2}\right )} f x -{\left ({\left (A + 2 \, B\right )} c^{2} + 2 \,{\left (2 \, A - 5 \, B\right )} c d -{\left (5 \, A - 11 \, B\right )} d^{2} + 3 \,{\left (2 \, B c d +{\left (A - 2 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right )^{2} -{\left ({\left (2 \, A + B\right )} c^{2} + 2 \,{\left (A - 4 \, B\right )} c d -{\left (4 \, A - 13 \, B\right )} d^{2} - 3 \,{\left (2 \, B c d +{\left (A - 2 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right ) -{\left (3 \, B d^{2} \cos \left (f x + e\right )^{2} -{\left (A - B\right )} c^{2} + 2 \,{\left (A - B\right )} c d -{\left (A - B\right )} d^{2} - 6 \,{\left (2 \, B c d +{\left (A - 2 \, B\right )} d^{2}\right )} f x +{\left ({\left (A + 2 \, B\right )} c^{2} + 2 \,{\left (2 \, A - 5 \, B\right )} c d -{\left (5 \, A - 14 \, B\right )} d^{2} - 3 \,{\left (2 \, B c d +{\left (A - 2 \, B\right )} d^{2}\right )} f x\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{3 \,{\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f -{\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/3*(3*B*d^2*cos(f*x + e)^3 - (A - B)*c^2 + 2*(A - B)*c*d - (A - B)*d^2 + 6*(2*B*c*d + (A - 2*B)*d^2)*f*x - (
(A + 2*B)*c^2 + 2*(2*A - 5*B)*c*d - (5*A - 11*B)*d^2 + 3*(2*B*c*d + (A - 2*B)*d^2)*f*x)*cos(f*x + e)^2 - ((2*A
 + B)*c^2 + 2*(A - 4*B)*c*d - (4*A - 13*B)*d^2 - 3*(2*B*c*d + (A - 2*B)*d^2)*f*x)*cos(f*x + e) - (3*B*d^2*cos(
f*x + e)^2 - (A - B)*c^2 + 2*(A - B)*c*d - (A - B)*d^2 - 6*(2*B*c*d + (A - 2*B)*d^2)*f*x + ((A + 2*B)*c^2 + 2*
(2*A - 5*B)*c*d - (5*A - 14*B)*d^2 - 3*(2*B*c*d + (A - 2*B)*d^2)*f*x)*cos(f*x + e))*sin(f*x + e))/(a^2*f*cos(f
*x + e)^2 - a^2*f*cos(f*x + e) - 2*a^2*f - (a^2*f*cos(f*x + e) + 2*a^2*f)*sin(f*x + e))

________________________________________________________________________________________

Sympy [A]  time = 23.2995, size = 5358, normalized size = 40.59 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2/(a+a*sin(f*x+e))**2,x)

[Out]

Piecewise((-6*A*c**2*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**
2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*A*c**2*tan
(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3
+ 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 10*A*c**2*tan(e/2 + f*x/2)**2/(3*a**
2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f
*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*A*c**2*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9
*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2
 + f*x/2) + 3*a**2*f) - 4*A*c**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(
e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 12*A*c*d*tan(e/2 + f
*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**
2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 4*A*c*d*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/
2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 +
 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 12*A*c*d*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*ta
n(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2)
+ 3*a**2*f) - 4*A*c*d/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2
)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 3*A*d**2*f*x*tan(e/2 + f*x/2)**
5/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan
(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 9*A*d**2*f*x*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2
+ f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9
*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 12*A*d**2*f*x*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**
2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f
*x/2) + 3*a**2*f) + 12*A*d**2*f*x*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2
)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) +
 9*A*d**2*f*x*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/
2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 3*A*d**2*f*x/(3*a**2*f
*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/
2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 6*A*d**2*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9
*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2
 + f*x/2) + 3*a**2*f) + 18*A*d**2*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2
)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) +
 14*A*d**2*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/
2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 18*A*d**2*tan(e/2 + f*
x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*
tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 8*A*d**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*
f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x
/2) + 3*a**2*f) - 6*B*c**2*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 +
12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 2*B*c*
*2*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/
2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*B*c**2*tan(e/2 + f*x/2)/(3*a
**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 +
 f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 2*B*c**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2
 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a
**2*f) + 6*B*c*d*f*x*tan(e/2 + f*x/2)**5/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**
2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 18*B*c*d*f*x
*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)
**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 24*B*c*d*f*x*tan(e/2 + f*x/2)**3
/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(
e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 24*B*c*d*f*x*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 +
 f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*
a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 18*B*c*d*f*x*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*t
an(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2)
 + 3*a**2*f) + 6*B*c*d*f*x/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 +
f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 12*B*c*d*tan(e/2 + f*x/2)*
*4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*ta
n(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 36*B*c*d*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f
*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a*
*2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 28*B*c*d*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(
e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) +
3*a**2*f) + 36*B*c*d*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f
*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) + 16*B*c*d/(3*a**
2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f
*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*B*d**2*f*x*tan(e/2 + f*x/2)**5/(3*a**2*f*tan(e/2 + f*x/2)
**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*
tan(e/2 + f*x/2) + 3*a**2*f) - 18*B*d**2*f*x*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(
e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) +
3*a**2*f) - 24*B*d**2*f*x*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 1
2*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 24*B*d*
*2*f*x*tan(e/2 + f*x/2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 +
f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 18*B*d**2*f*x*tan(e/2 + f*
x/2)/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*
tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 6*B*d**2*f*x/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a
**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 +
 f*x/2) + 3*a**2*f) - 12*B*d**2*tan(e/2 + f*x/2)**4/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)*
*4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 3
6*B*d**2*tan(e/2 + f*x/2)**3/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2
+ f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 44*B*d**2*tan(e/2 + f*x/
2)**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f
*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 48*B*d**2*tan(e/2 + f*x/2)/(3*a**2*f*tan(e/2 +
f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 + 12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a
**2*f*tan(e/2 + f*x/2) + 3*a**2*f) - 20*B*d**2/(3*a**2*f*tan(e/2 + f*x/2)**5 + 9*a**2*f*tan(e/2 + f*x/2)**4 +
12*a**2*f*tan(e/2 + f*x/2)**3 + 12*a**2*f*tan(e/2 + f*x/2)**2 + 9*a**2*f*tan(e/2 + f*x/2) + 3*a**2*f), Ne(f, 0
)), (x*(A + B*sin(e))*(c + d*sin(e))**2/(a*sin(e) + a)**2, True))

________________________________________________________________________________________

Giac [B]  time = 1.23681, size = 374, normalized size = 2.83 \begin{align*} \frac{\frac{3 \,{\left (2 \, B c d + A d^{2} - 2 \, B d^{2}\right )}{\left (f x + e\right )}}{a^{2}} - \frac{6 \, B d^{2}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 1\right )} a^{2}} - \frac{2 \,{\left (3 \, A c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 6 \, B c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 3 \, A d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 6 \, B d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 3 \, A c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, B c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 6 \, A c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 18 \, B c d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 9 \, A d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 15 \, B d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 2 \, A c^{2} + B c^{2} + 2 \, A c d - 8 \, B c d - 4 \, A d^{2} + 7 \, B d^{2}\right )}}{a^{2}{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )}^{3}}}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^2,x, algorithm="giac")

[Out]

1/3*(3*(2*B*c*d + A*d^2 - 2*B*d^2)*(f*x + e)/a^2 - 6*B*d^2/((tan(1/2*f*x + 1/2*e)^2 + 1)*a^2) - 2*(3*A*c^2*tan
(1/2*f*x + 1/2*e)^2 - 6*B*c*d*tan(1/2*f*x + 1/2*e)^2 - 3*A*d^2*tan(1/2*f*x + 1/2*e)^2 + 6*B*d^2*tan(1/2*f*x +
1/2*e)^2 + 3*A*c^2*tan(1/2*f*x + 1/2*e) + 3*B*c^2*tan(1/2*f*x + 1/2*e) + 6*A*c*d*tan(1/2*f*x + 1/2*e) - 18*B*c
*d*tan(1/2*f*x + 1/2*e) - 9*A*d^2*tan(1/2*f*x + 1/2*e) + 15*B*d^2*tan(1/2*f*x + 1/2*e) + 2*A*c^2 + B*c^2 + 2*A
*c*d - 8*B*c*d - 4*A*d^2 + 7*B*d^2)/(a^2*(tan(1/2*f*x + 1/2*e) + 1)^3))/f